//
//  JWCalendarModel.h
//  SiqiCalendar
//
//  Created by sunjiawen on 2018/4/4.
//  Copyright © 2018年 sjw. All rights reserved.
//

#import <Realm/Realm.h>
#import "JWScheduleModel.h"

static NSString *const kCalendarId                      = @"calendarId";
static NSString *const kCalendarName                    = @"calendarName";
static NSString *const kScheduleStatus                  = @"scheduleStatus";
static NSString *const kPeriod                          = @"period";
static NSString *const kExchangedDate                   = @"exchangedDate";
static NSString *const kFirstDate                       = @"firstDate";
static NSString *const kIsDefault                       = @"isDefault";
static NSString *const kCalendarOrderIndex              = @"orderIndex";

@interface JWCalendarModel : RLMObject

/** 键 */
@property NSString *calendarId;

/** 日历名称 */
@property NSString *calendarName;

/** 倒班信息 */
@property RLMArray<JWScheduleModel *><JWScheduleModel> *scheduleStatus;

/** 倒班周期 */
//@property NSNumber<RLMInt> *period;

/** 串班日期 */
@property NSString *exchangedDate; //Json 格式

/** yyyy-MM-dd 该班的第一个日期 */
@property NSDate *firstDate;

/** 是否为默认显示 YES:默认显示 FALSE：不是默认显示 */
@property NSNumber<RLMBool> * isDefault;

/** 排序 从0开始*/
@property NSNumber<RLMInt> * orderIndex;

- (void)updateCalendarName:(NSString *)calendarName;

- (void)updateFirstDate:(NSDate *)firstDate;

- (void)updateIsDefault:(NSNumber<RLMBool> *)isDefault;

- (void)updateOrderIndex:(NSNumber<RLMInt> *)orderIndex;

- (void)updateExchangedDate:(NSString *)exchangedDate;

+ (instancetype)modelWithCalendarModel:(JWCalendarModel *)calendarModel;
@end
